package cn.lastjune.pojo;

// Generated 2011-3-27 20:32:23 by Hibernate Tools 3.4.0.CR1

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;



/**
 * Problem generated by hbm2java
 */
@Entity
@Table(name = "PROBLEM", schema = "CGB2")
public class Problem implements java.io.Serializable {

	private String eventcauseid;
	private Area area;
	private BigDecimal recid;
	private BigDecimal eventsrcid;
	private String eventsrc;
	private String eventsubsrc;
	private String eventtype;
	private String bigcategory;
	private String smallcategory;
	private String subcategory;
	private String eventstate;
	private String ebentsubstate;
	private String currentstatename;
	private Set<Reportpeople> reportpeoples = new HashSet<Reportpeople>(0);
	private Set<Area> areas = new HashSet<Area>(0);

	public Problem() {
	}

	public Problem(String eventcauseid) {
		this.eventcauseid = eventcauseid;
	}

	public Problem(String eventcauseid, Area area, BigDecimal recid,
			BigDecimal eventsrcid, String eventsrc, String eventsubsrc,
			String eventtype, String bigcategory, String smallcategory,
			String subcategory, String eventstate, String ebentsubstate,
			String currentstatename, Set<Reportpeople> reportpeoples,
			Set<Area> areas) {
		this.eventcauseid = eventcauseid;
		this.area = area;
		this.recid = recid;
		this.eventsrcid = eventsrcid;
		this.eventsrc = eventsrc;
		this.eventsubsrc = eventsubsrc;
		this.eventtype = eventtype;
		this.bigcategory = bigcategory;
		this.smallcategory = smallcategory;
		this.subcategory = subcategory;
		this.eventstate = eventstate;
		this.ebentsubstate = ebentsubstate;
		this.currentstatename = currentstatename;
		this.reportpeoples = reportpeoples;
		this.areas = areas;
	}

	@Id
	@Column(name = "EVENTCAUSEID", unique = true, nullable = false, length = 20)
	public String getEventcauseid() {
		return this.eventcauseid;
	}

	public void setEventcauseid(String eventcauseid) {
		this.eventcauseid = eventcauseid;
	}

	@ManyToOne(fetch = FetchType.LAZY,optional=true,cascade= {CascadeType.ALL})
	@JoinColumn(name = "AREAID")
	public Area getArea() {
		return this.area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	@Column(name = "RECID", precision = 22, scale = 0)
	public BigDecimal getRecid() {
		return this.recid;
	}

	public void setRecid(BigDecimal recid) {
		this.recid = recid;
	}

	@Column(name = "EVENTSRCID", precision = 22, scale = 0)
	public BigDecimal getEventsrcid() {
		return this.eventsrcid;
	}

	public void setEventsrcid(BigDecimal eventsrcid) {
		this.eventsrcid = eventsrcid;
	}

	@Column(name = "EVENTSRC", length = 40)
	public String getEventsrc() {
		return this.eventsrc;
	}

	public void setEventsrc(String eventsrc) {
		this.eventsrc = eventsrc;
	}

	@Column(name = "EVENTSUBSRC", length = 40)
	public String getEventsubsrc() {
		return this.eventsubsrc;
	}

	public void setEventsubsrc(String eventsubsrc) {
		this.eventsubsrc = eventsubsrc;
	}

	@Column(name = "EVENTTYPE", length = 40)
	public String getEventtype() {
		return this.eventtype;
	}

	public void setEventtype(String eventtype) {
		this.eventtype = eventtype;
	}

	@Column(name = "BIGCATEGORY", length = 40)
	public String getBigcategory() {
		return this.bigcategory;
	}

	public void setBigcategory(String bigcategory) {
		this.bigcategory = bigcategory;
	}

	@Column(name = "SMALLCATEGORY", length = 40)
	public String getSmallcategory() {
		return this.smallcategory;
	}

	public void setSmallcategory(String smallcategory) {
		this.smallcategory = smallcategory;
	}

	@Column(name = "SUBCATEGORY", length = 40)
	public String getSubcategory() {
		return this.subcategory;
	}

	public void setSubcategory(String subcategory) {
		this.subcategory = subcategory;
	}

	@Column(name = "EVENTSTATE", length = 40)
	public String getEventstate() {
		return this.eventstate;
	}

	public void setEventstate(String eventstate) {
		this.eventstate = eventstate;
	}

	@Column(name = "EBENTSUBSTATE", length = 40)
	public String getEbentsubstate() {
		return this.ebentsubstate;
	}

	public void setEbentsubstate(String ebentsubstate) {
		this.ebentsubstate = ebentsubstate;
	}

	@Column(name = "CURRENTSTATENAME", length = 40)
	public String getCurrentstatename() {
		return this.currentstatename;
	}

	public void setCurrentstatename(String currentstatename) {
		this.currentstatename = currentstatename;
	}

	@ManyToMany(fetch = FetchType.LAZY,cascade= {CascadeType.ALL})
	@JoinTable(name = "RELATIONSHIP_6", schema = "CGB2", joinColumns = { @JoinColumn(name = "EVENTCAUSEID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "REPORTPEOPLEID", nullable = false, updatable = false) })
	public Set<Reportpeople> getReportpeoples() {
		return this.reportpeoples;
	}

	public void setReportpeoples(Set<Reportpeople> reportpeoples) {
		this.reportpeoples = reportpeoples;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "problem",cascade= {CascadeType.ALL})
	public Set<Area> getAreas() {
		return this.areas;
	}

	public void setAreas(Set<Area> areas) {
		this.areas = areas;
	}

}
